home *** CD-ROM | disk | FTP | other *** search
/ Programming a Multiplayer FPS in DirectX / Programming a Multiplayer FPS in DirectX (Companion CD).iso / DirectX / dxsdk_oct2004.exe / dxsdk.exe / Samples / Managed / Direct3D / Scripting / Script1.cs < prev    next >
Encoding:
Text File  |  2004-09-27  |  960 b   |  33 lines

  1. //--------------------------------------------------------------------------------------
  2. // File: Script1.cs
  3. //
  4. // Scripting code for Managed Scripting sample
  5. //
  6. // Copyright (c) Microsoft Corporation. All rights reserved.
  7. //--------------------------------------------------------------------------------------
  8. using System;
  9.  
  10. /// <summary>
  11. /// Handles scripts for the ShadowVolume sample
  12. /// </summary>
  13. class ScriptClass
  14. {
  15.     /// <summary>
  16.     /// Updates dwarf's position
  17.     /// </summary>
  18.     public static void UpdatePosition(double appTime, ref float x, ref float y, ref float z)
  19.     {
  20.         x = (float)Math.Sin(appTime);
  21.         z = (float)Math.Cos(appTime);
  22.         y = (float)Math.Abs(Math.Sin(appTime)); 
  23.     }
  24.  
  25.     /// <summary>
  26.     /// Update dwarf's rotation
  27.     /// </summary>
  28.     public static void UpdateRotationY(double appTime, ref float a)
  29.     {
  30.         a = (float)((appTime * 5) / (Math.PI * 2));
  31.     }
  32. }
  33.